aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/invoice/[id]/[email protected]
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)/invoice/[id]/[email protected]')
-rw-r--r--src/routes/(app)/invoice/[id]/[email protected]20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/routes/(app)/invoice/[id]/[email protected] b/src/routes/(app)/invoice/[id]/[email protected]
index 62c05db1..05fd603f 100644
--- a/src/routes/(app)/invoice/[id]/[email protected]
+++ b/src/routes/(app)/invoice/[id]/[email protected]
@@ -1,4 +1,6 @@
<script>
+ import { run } from 'svelte/legacy';
+
import { SvelteToast } from "@zerodevx/svelte-toast";
import { onDestroy, onMount } from "svelte";
import { close, connect, send } from "$lib/socket";
@@ -22,16 +24,14 @@
import { t, locale, loading } from "$lib/translations";
import { goto, onNavigate } from "$app/navigation";
- export let data;
+ let { data, children } = $props();
- let { generate, rate, user, subject, token, rates, theme } = data;
+ let { generate, rate, user, subject, token, rates, theme } = $state(data);
- $: update(data);
let update = (data) => {
({ rate, user, subject, token, rates, theme } = data);
};
- $: theme = $themeStore;
$themeStore = theme;
onMount(async () => {
@@ -58,7 +58,6 @@
}
});
- $: browser && connect(token);
let lost,
checkTimer,
@@ -84,6 +83,15 @@
clearTimeout(expireTimer);
}
});
+ run(() => {
+ update(data);
+ });
+ run(() => {
+ theme = $themeStore;
+ });
+ run(() => {
+ browser && connect(token);
+ });
</script>
{#if browser && user && $passwordPrompt}
@@ -110,7 +118,7 @@
<main class="min-h-dvh" data-theme={theme}>
<AppHeader {user} {subject} />
{#if !$loading}
- <slot />
+ {@render children?.()}
{/if}
</main>